package com.wisely.xxboot.web;

import com.wisely.xxboot.dao.RedisPerson;
import com.wisely.xxboot.domain.RedisPersonDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>Description:</p>
 * <p>Copyright: Copyright (c) 2017</p>
 * <p>Company: 中视数讯</p>
 * <p>Site: www.digi-zones.com</p>
 *
 * @author shengping
 * @version 1.0
 * @date 2017/7/3
 */
@RestController
public class RedisDataController {
    @Autowired
    RedisPersonDao redisPersonDao;

    @RequestMapping("/redisset")
    public void set(){
        RedisPerson redisPerson = new RedisPerson("1","aping",28);
        redisPersonDao.save(redisPerson);
        redisPersonDao.stringRedisTemplateDemo();
    }

    @RequestMapping("/redisgetStr")
    public String getStr(){
        return redisPersonDao.getString();
    }

    @RequestMapping("/redisgetPersion")
    public RedisPerson getPerson(){
        return redisPersonDao.getPerson();
    }
}
